<?php
header("context-type:html/text;charset=utf-8");
mysql_connect("localhost","root","root");
mysql_select_db("hotel");
$sql="select *from user order by userId asc";
$res=mysql_query($sql);
$arr=array();
while($row = mysql_fetch_assoc($res)){
    array_push($arr,$row);
}    
print_r(json_encode($arr))
?>